package com.weaver.qfengx.api.sf.shundiantong;

import com.weaver.qfengx.StringUtils;

public class ShundiantongApiResult {

    private String errorCode;
    private String message;
    private int httpStatus;
    private Object data;
    private String requestId;

    public static ShundiantongApiResult createResult(String code, String message, int httpStatus, String requestId, Object data) {
        return new ShundiantongApiResult().setHttpStatus(httpStatus).setRequestId(requestId)
                .setErrorCode(code).setMessage(message).setData(data);
    }

    @Override
    public String toString() {
        return "ShundiantongApiResult{" +
                "errorCode='" + errorCode + '\'' +
                ", message='" + message + '\'' +
                ", httpStatus=" + httpStatus +
                ", data=" + data +
                ", requestId='" + requestId + '\'' +
                '}';
    }

    public String getRequestId() {
        return requestId;
    }

    public ShundiantongApiResult setRequestId(String requestId) {
        this.requestId = requestId;
        return this;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public ShundiantongApiResult setErrorCode(String errorCode) {
        this.errorCode = errorCode;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public ShundiantongApiResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public int getHttpStatus() {
        return httpStatus;
    }

    public ShundiantongApiResult setHttpStatus(int httpStatus) {
        this.httpStatus = httpStatus;
        return this;
    }

    public Object getData() {
        return data;
    }

    public ShundiantongApiResult setData(Object data) {
        this.data = data;
        return this;
    }

    public boolean isOk() {
        return StringUtils.equals("0", errorCode);
    }
}
